home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Modules / BackSpaceModules / Source / Swarm / SwarmView.h < prev    next >
Text File  |  1991-11-30  |  2KB  |  59 lines

  1. #import "BackView.h"
  2.  
  3. // Constants
  4. #define TRUE 1
  5. #define FALSE 0
  6. #define STD_STR    100
  7. #define BEES    50    /* number of bees */
  8. #define MAXBEES 500    // maximum number of bees
  9. #define TIMES    3    /* number of time positions recorded */
  10. #define BEEACC    3    /* acceleration of bees */
  11. #define WASPACC 5    /* maximum acceleration of wasp */
  12. #define BEEVEL    11    /* maximum bee velocity */
  13. #define WASPVEL 12    /* maximum wasp velocity */
  14. #define BORDER    50    /* wasp won't go closer than this to the edges */
  15.  
  16. /* Macros */
  17. #define X(t,b)    (x[t*bees + b])        /* addressing into dynamic array */
  18. #define Y(t,b)    (y[t*bees + b])        /* addressing into dynamic array */
  19. #define RAND(v)    ((random() % v) - (v/2)) /* random number around 0 */
  20.  
  21. @interface SwarmView:BackView
  22. //@interface SwarmView:View
  23. {
  24. /* animation related */
  25. int    times;            /* number of time steps recorded  */
  26. int    bees, newbees;        /* number of bees */
  27. int    wasp_vel;        /* maximum wasp speed */
  28. int    bee_vel;        /* maximum bee speed */
  29. int    wasp_acc;        /* maximum wasp acceleration */
  30. int    bee_acc;        /* bee acceleration */
  31. int    delay;            /* delay between updates, in microseconds */
  32. int    timeout;        /* time in seconds before screen saving */
  33. int    border;            /* border limiting wasp travel */
  34. char    stop;
  35. int    verbose;        /* display settings if TRUE */
  36. int    stay_in_front;        /* Try to stay in clear area of the screen. */
  37. int    root;            /* display in root window */
  38. int    pointer;        /* control wasp with mouse */
  39. int    *x, *y;            /* bee positions x[time][bee#] */
  40. int    *xv, *yv;        /* bee velocities xv[bee#] */
  41. int    wx[3], wy[3];        /* wasp positions */
  42. int    wxv, wyv;        /* wasp velocity */
  43. int    mywidth, myheight;    /* how big am I? */
  44. int    winNum;            /* who am I?     */
  45. float    curX, curY;        /* where am I?     */
  46. int    cursortime;        /* How long have I followed the cursor */
  47. id    myPrefWindow;        // Preferances Window
  48. id    beeText;        // Number of Bees
  49. }
  50.  
  51. - show;
  52. - setNumberBees: sender;
  53. - setFollow: sender;
  54. - sizeTo:(NXCoord)width :(NXCoord)height;
  55. - oneStep;
  56. - newSize;
  57. @end
  58.  
  59.